package com.lantosec.hmrp.modules.supplier.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.supplier.vo.SupplierLinkmanVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 供应商联系人 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupplierLinkman extends BaseEntity<SupplierLinkmanVO> {

    private static final long serialVersionUID = 1L;
    public SupplierLinkman(SupplierLinkmanVO vo){
        this.linkmanId = vo.getLinkmanId();
        this.supplierCode = vo.getSupplierCode();
        this.linkmanTitle = vo.getLinkmanTitle();
        this.linkmanName = vo.getLinkmanName();
        this.linkmanTel = vo.getLinkmanTel();
        this.idcard = vo.getIdcard();
        this.idcardFront = vo.getIdcardFront();
        this.idcardBack = vo.getIdcardBack();
        this.idcardEnd = vo.getIdcardEnd();
        this.salesmanFlag = vo.getSalesmanFlag();
        this.qualification = vo.getQualification();
        this.qualificationEnd = vo.getQualificationEnd();
        this.createTime = vo.getCreateTime();
        this.createUser = vo.getCreateUser();
        this.supplierName = vo.getSupplierName();
    }

    @Override
    public SupplierLinkmanVO convertToVO(){
        return new SupplierLinkmanVO(this);
    }


    /**
     * ID
     */
    @TableId(value = "linkman_id", type = IdType.ASSIGN_UUID)
    private String linkmanId;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 头衔
     */
    private String linkmanTitle;

    /**
     * 姓名
     */
    private String linkmanName;

    /**
     * 联系电话
     */
    private String linkmanTel;

    /**
     * 身份证号
     */
    private String idcard;

    /**
     * 身份证正面，upload表ID
     */
    private String idcardFront;

    /**
     * 身份证正面，upload表ID
     */
    private String idcardBack;

    /**
     * 身份证到期日期(yyyy-MM-dd)
     */
    private String idcardEnd;

    /**
     * 是否业务员(1是0否)
     */
    private Integer salesmanFlag;

    /**
     * 购销资格证，upload表ID
     */
    private String qualification;

    /**
     * 购销资格证到期日期(yyyy-MM-dd)
     */
    private String qualificationEnd;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 供应商名称
     */
    @TableField(exist = false)
    private String supplierName;

    /**
     * "身份证正面保存路径"
     */
    @TableField(exist = false)
    private String idcardFrontSavePath;
    /**
     * "身份证反面保存路径"
     */
    @TableField(exist = false)
    private String idcardBackSavePath;
    /**
     * "购销资格证保存路径"
     */
    @TableField(exist = false)
    private String qualificationkSavePath;

    public enum ColName {
        linkman_id, supplier_code, linkman_title, linkman_name, linkman_tel, idcard, idcard_front, idcard_back, idcard_end, salesman_flag, qualification, qualification_end, create_time, create_user, 
    }
}
